package cn.gson.springboot.model.dao.afterdao;

import cn.gson.springboot.model.pjos.Expense;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface ExpenseDao extends CrudRepository<Expense, Integer> {
//    根据客户id查询销售费用
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "select * from expense where custom_id = ?1")
    public List<Expense> selectExpense(Integer congId);
//    合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update expense set custom_id = ?1 where custom_id = ?2")
    public void update(Integer daoId,Integer congId);
}
